<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Login_model extends CI_Model {

    function __construct()
    {
        // Call the Model constructor
        parent::__construct();
    }
    
    function check_entry($_POST){
		$query = $this->db->query("SELECT * FROM admin WHERE username = '".$_POST["username"]."' and password = '".$_POST["password"]."' ");
		return $query->num_rows()>0?1:0;
	}
	
	function logout()
	{
		$_SESSION = array();
		
		if (ini_get("session.use_cookies")) {
			$params = session_get_cookie_params();
			setcookie(session_name(), '', time() - 42000,
				$params["path"], $params["domain"],
				$params["secure"], $params["httponly"]
			);
		}
		session_destroy();
	}
}
/* End of file login_model.php */
/* Location: ./application/models/login_model.php */
?>